package ywpt.service.knowledge;

import org.springframework.stereotype.Service;

import ywpt.core.dao.HibernateEntityDao;
import ywpt.model.KnowLib;
import ywpt.model.KnowScans;
@Service("knowScansService")
public class KnowScansServiceImpl extends HibernateEntityDao<KnowScans> implements KnowScansService{
	public KnowScansServiceImpl(){}

	@Override
	public KnowScans getKnowScansById(Long id) {
		return this.get(id);
	}

	@Override
	public void saveKnowScans(KnowScans ks, Long knowLibId) {
		if(knowLibId != null){
			ks.setKnowLib(this.get(KnowLib.class, knowLibId));
		}
		super.save(ks);
	}

	@Override
	public void removeKnowScans(Long id) {
		this.removeById(id);
	}
}
